package com.miracle.java2110.mapper;

import com.miracle.java2110.pojo.Serviced;
import com.miracle.java2110.pojo.ServiceType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface ServiceMapper {
    public List<ServiceType> selectAll(Map<String, Object> param);

    @Insert("insert into service_type value(#{id},#{serviceType})")
    public int addServiceType(ServiceType st);

    @Delete("delete from service_type where id = #{id}")
    Integer deleteById(@Param("id") Integer id);

    @Update("update service_type set serviceType=#{serviceType} where id=#{id}")
    Integer updateById(ServiceType st);

    public List<Serviced> selectAllService(Map<String, Object> param);

    @Insert("insert into service values(#{id},#{sname},#{sprice},#{sintroduce},#{sevaluate},#{sid})")
    public int addService(Serviced serviced);

    @Delete("delete from service where id = #{id}")
    Integer deleteServiceById(@Param("id") Integer id);

    Integer updateService(Serviced serviced);

    Integer deleteServiced(int[] array);
}
